<?php
use \Firebase\JWT\JWT;
require './vendor/autoload.php';
ini_set("display_errors","On");
error_reporting(E_ALL);

$headers = getallheaders(); //获取所有header头信息

if (!isset($headers['Token'])) {
    echo 'No Have Token'; die;
}
$key = "wrkwd";
$token = $headers['Token'];

try {
    $decoded = JWT::decode($token, $key, array('HS256'));
    echo 'Token 有效';
    
} catch (Firebase\JWT\ExpiredException $exception){
    echo 'Token 无效';
}

